package com.fowo.api.sys.performance.properties;

import com.fowo.api.sys.performance.PerformanceLogWriter;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.List;

/**
 * 性能日志配置属性
 */
@Component
@ConfigurationProperties(prefix = "app.performance-log")
@Getter
@Setter
public class PerformanceLogProperties implements Serializable {

    /**
     * 指定要使用的日志写入器
     */
    private Class<? extends PerformanceLogWriter> writer;

    /**
     * 切面表达式
     */
    private String aspectExpression;

    /**
     * 批量写入的单次最大写入数
     */
    private int maxWriteRecords = 100;

    /**
     * 批量写入的单次最大间隔时间(秒)
     */
    private int maxWaitTime = 1;

    /**
     * 用于 {@link com.fowo.api.sys.performance.writer.TextPerformanceLogWriter} 中表示文本日志输出的文件夹
     */
    private String logDir;
}
